package main

import (
	"math/rand/v2"
	"time"

	"gitee.com/leminewx/gokit/app/progressbar"
)

func main() {
	var total int64 = 10000000
	bar := progressbar.New(total).WithPrefix("升级设备：").WithStyle(progressbar.STYLE_BAR_POINT)
	for i := int64(0); i <= total; i++ {
		time.Sleep(time.Duration(rand.IntN(50)) * time.Millisecond)
		bar.Add(rand.Int64N(100000))
		if bar.IsFinshed() {
			break
		}
	}
}
